package com.sun.mybatisplus.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.mybatisplus.entity.BeautyInfo;
import com.sun.mybatisplus.mapper.BeautyMapper;
import com.sun.mybatisplus.service.BeautyService;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BeautyServiceImpl extends ServiceImpl<BeautyMapper, BeautyInfo> implements BeautyService {

    @Autowired
    private BeautyMapper beautyMapper;


    @Trace
    @Tag(key = "selectAllTrace", value = "returnedObj")
    @Override
    public List<BeautyInfo> selectAllTrace() {
        return beautyMapper.selectAllTrace();
    }

    @Override
    public IPage<BeautyInfo> selectBeautyByPage(IPage<BeautyInfo> page, BeautyInfo beautyInfo) {
        List<BeautyInfo> infoList = baseMapper.selectBeautyByPage(beautyInfo,page);
        return page.setRecords(infoList);
    }
}
